package senior.SuperMarket;

import java.util.Objects;

/**
 *
 *会员：编号，姓名，手机，积分。。。
 * @author shkstart
 * @creat 2022-04-11:38
 */
public class Customer {
    private String no;
    private String name;
    private String phone;
    private int jifen;
    private String pwd;

    public Customer() {
        pwd = "123456";
    }

    public Customer(String  no, String name, String phone, int jifen) {
        this.no = no;
        this.name = name;
        this.phone = phone;
        this.jifen = jifen;
        pwd = "123456";
    }

    public String  getNo() {
        return no;
    }

    public void setNo(String  no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getJifen() {
        return jifen;
    }

    public void setJifen(int jifen) {
        this.jifen = jifen;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    @Override
    public String toString() {
        return
                "编号：" + no +
                ", 姓名：" + name +
                ", 手机号" + phone +
                ", 积分：" + jifen ;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Customer customer = (Customer) o;
        return Objects.equals(no, customer.no);
    }

    @Override
    public int hashCode() {
        return Objects.hash(no);
    }
}
